import java.util.Scanner;
//求二进制1的个数
public class TestDemo {
    public static void main10(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;

        while (n != 0) {
            n = n & (n-1) ;
            count++;
        }

        System.out.println(count);
    }

    public static void main9(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;

        while (n != 0) {
            if((n & 1) != 0) {
                count++;
            }
            n = n >>> 1;
        }

        System.out.println(count);
    }

    public static void main8(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count = 0;
        for (int i = 0; i < 32; i++) {
            if( ((n >>> i) & 1) != 0) {
                count++;
            }
        }
        System.out.println(count);
    }
}
